CPU components (cont.)

Example: Steps to executing an sw (store word) instruction:

  1. Instruction goes to instruction memory
    • Instruction memory goes to RAM at address given by PC
    • Instruction gets stored in "instruction register" within instruction memory
  2. Instruction is disassembled into parts which go to different components of the CPU
    • e.g., register #1 goes to register file - 5 bits
  3. Register in register file goes to ALU to be added with immediate value, so that the store word instruction gets the address with the correct offset

Additional components:

Note: Not expected to memorize circuitry for exam, but expected to understand picture. Should be able to, e.g.:

Recall the machine cycle steps:

Each time the "fetch" instruction happens, the PC is immediately updated to the new value.

Argument registers:

Example: BEQ instruction steps

  1. PC passes instruction address to instruction memory
  2. Instruction register arguments passed to register file
  3. Argument registers go to ALU - compare values by subtracting
  4. Check difference:

Control units

ALU control unit:

ALU control input table

(big) Control Unit:

Control unit

Example use of control units: determine the values of each of the control lines for the below instruction:

add $s0, $t5, $t6

Opcode: 000000 because this is an R-type instruction.

Control line values: